package com.ruoyi.hqfinance.service.impl;

import com.ruoyi.hqfinance.domain.HqCostKind;
import com.ruoyi.hqfinance.mapper.HqCostKindMapper;
import com.ruoyi.hqfinance.service.HqCostKindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HqCostKindMapperImpl implements HqCostKindService {
    @Autowired
    private HqCostKindMapper hqCostKindMapper;
    @Override
    public List<HqCostKind> selectAll() {
        return hqCostKindMapper.selectAll();
    }

    @Override
    public Boolean insert(HqCostKind hqCostKind) {
        return hqCostKindMapper.insert(hqCostKind);
    }

    @Override
    public Boolean update(HqCostKind hqCostKind) {
        return hqCostKindMapper.update(hqCostKind);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return hqCostKindMapper.deleteById(id);
    }

    @Override
    public List<HqCostKind> selectByOneLevel() {
        return hqCostKindMapper.selectByOneLevel();
    }

    @Override
    public List<HqCostKind> selectByTwoLevel() {
        return hqCostKindMapper.selectByTwoLevel();
    }

    @Override
    public List<HqCostKind> selectByThreeLevel() {
        return hqCostKindMapper.selectByThreeLevel();
    }

    @Override
    public List<HqCostKind> selectByParentId(String name) {
        Integer id = hqCostKindMapper.findByName(name);
        return hqCostKindMapper.selectByParentId(id);
    }


}
